package com.gxa.modules.sys.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gxa.common.validator.group.AddGroup;
import com.gxa.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@ApiModel("注册模型")
public class UserDto {
    @ApiModelProperty("账户")
    @NotBlank(message="账户不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    @ApiModelProperty("用户名")
    private String uname;

    @ApiModelProperty("密码")
    @NotBlank(message="密码不能为空", groups = AddGroup.class)
    private String pwd;

    @JsonIgnore
    @ApiModelProperty("盐值")
    private String salt;

    @JsonIgnore
    @ApiModelProperty("状态")
    private Integer state;

    @ApiModelProperty("电话号码")
    private String tel;

    @JsonIgnore
    @ApiModelProperty("注册时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("registration_time")
    private Date registrationTime;

}
